#include<stdio.h>


int MyStrlen1(char* str)
{
	int count = 0;
	while (*str != '\0')
	{
		count++;
		str++;
	}

	return count;
}

int MyStrlen2(char* str)
{
	if (*str == '\0')
		return 0;
	else
		return 1 + MyStrlen2(str + 1);
}

int MyStrlen3(char str[])
{
	char* start = str;
	while (*str++)
		;

	return str - start - 1;
}

int main()
{
	char str[] = "abcdef";
	int len1 = MyStrlen1(str);
	int len2 = MyStrlen2(str);
	int len3 = MyStrlen3(str);

	printf("len 1 = %d\n", len1);
	printf("len 2 = %d\n", len2);
	printf("len 3 = %d\n", len3);
	return 0;
}

